<template>
	<view class="fixed-title">
		<view :style="{ height: statusBarHeight }" class="uni-status-bar">
		
		</view>
		<view class="title">{{centerName}}</view>
	</view>
</template>

<script>
	export default {
		props:{
			centerName:{
				type:String,
				default:"帮你吖"
			}
		},
		data() {
			return {
				statusBarHeight: 20
			}
		},
		methods: {
			
		},
		mounted() {
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
			console.log(this.statusBarHeight);
		}
	}
</script>

<style lang="scss" scoped>
	.fixed-title{
		position: fixed;
		top: 0;
		z-index: 999;
		width: 100%;
		
		background:  rgba(255, 200, 47, 0.24);
	}
	.title{
		line-height: 44px;
		text-align: center;
		font-size: 32rpx;
		font-weight: 500;
		 height: 44px;
		color: rgba(0, 0, 0, 1);
	 
	}
	.uni-status-bar {
		// background-color: $btn-bg;
	
		height: 20px;
	}
</style>
